Skip to content

v3.3.2 #170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 14, 2023
Merged

v3.3.2 #170

merged 8 commits into from
Aug 14, 2023

Conversation

Archmonger
Copy link
Contributor

@Archmonger Archmonger commented Aug 9, 2023

By submitting this pull request you agree that all contributions to this project are made under the MIT license.

Description

Added

  • ReactPy Websocket will now decode messages via orjson resulting in an ~6% overall performance boost.
  • Built-in asyncio event loops are now patched via nest_asyncio, resulting in an ~10% overall performance boost on Windows. This has no performance impact if you are running your webserver with uvloop.

Fixed

  • Fix bug where REACTPY_WEBSOCKET_URL always generates a warning if unset.
  • Fixed bug where assert f is self._write_fut would be raised within uvicorn on Windows when REACTPY_BACKHAUL_THREAD = True.
  • Fixed bug where rendering behavior would be jittery with daphne on Windows when REACTPY_BACKHAUL_THREAD = True.

@Archmonger
Copy link
Contributor Author

Archmonger commented Aug 13, 2023

@rmorshea I'm going to merge this as a temporary hotfix, but I'm honestly kind of shocked using nest_asyncio fixes both assert f is self._write_fut exceptions on Uvicorn and also jittery rendering behavior Daphne.

My best guess is the way that the Windows ProactorEventLoop enqueues tasks is inherently not thread safe, and maybe nest_asyncio serializes this task queue? I'm even more shocked that this results in a overall performance improvement.

There's still one open bug: Some Windows environments have degraded performance when running via backhaul thread. I've actually experienced this once in the past, but I've been unable to replicate it.

Will need to do a deeper dive into this in the future. Given that the issue existed for me before but is now gone (same Python version), this is likely somehow related to CPython optimizations.

@Archmonger Archmonger marked this pull request as ready for review August 13, 2023 23:56
@Archmonger Archmonger requested a review from a team as a code owner August 13, 2023 23:56
@Archmonger Archmonger merged commit b058b9e into reactive-python:main Aug 14, 2023
@Archmonger Archmonger deleted the 3.3.2 branch August 14, 2023 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant